import zipfile

Res2App = '/root/Oracle/Middleware/user_projects/app/Res2App.ear'
ResWebService = '/root/Oracle/Middleware/user_projects/app/ResWebService.war'
ResFtthApp = '/root/Oracle/Middleware/user_projects/domains/rescfg_domain/servers/AdminServer/upload/ResFtthApp.war'

Res2App = r'D:\镜像包\0801\Res2App.ear'
ResWebService = r'D:\镜像包\0801\ResWebService.war'
ResFtthApp = r'D:\镜像包\0801\ResFtthApp.war'



def modify_res2App(filename):
    z = zipfile.ZipFile(filename,'w')
    res2web = z.extract('Res2Web.war', '/tmp')
    r2wZIP = zipfile.ZipFile(res2web, 'r')
    with r2wZIP.open('WEB-INF/classes/Config.properties','w') as Configfile:
        pass

def modify_res2App2(filename):
    z = zipfile.ZipFile(filename,'r')

    Res2WebWAR = z.open('Res2Web.war','r')
    a =  zipfile.ZipFile(file(Res2WebWAR.read(),'r'),'r')
    print (a)

if __name__ == '__main__':
    modify_res2App2(Res2App)